<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>使用插槽(slot)</title>
  <script src="../static/vue.js"></script>
</head>
<body>
<div id="root">
  <body-content>
    <div class="header" slot="header">header</div>
    <div class="header" slot="header">header22</div>
    <div class="footer" slot="footer">footer</div>
  </body-content>
</div>
<script>
Vue.component('body-content',{
  template:'<div>' +

    '<slot name="header">默认值</slot>' +
    '<div class="content">content</div>' +
    '<slot name="footer">默认值</slot>' +
    '</div>'
})

  var vm = new Vue({
    el:'#root'
  })
</script>
</body>
</html>
